﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GDModel.Model.Map
{
    /// <summary>
    /// 代表一张Map中的一个区域,叫做房间,这里房间只是一个区域感念而不是一个具体的房间
    /// </summary>
    [Serializable]
    public class Room
    {
        private int m_id;
        /// <summary>
        /// ID
        /// </summary>
        public int Id
        {
            get { return m_id; }
            set { m_id = value; }
        }

        private string m_name;
        /// <summary>
        /// 房间名称
        /// </summary>
        public string Name
        {
            get { return m_name; }
            set { m_name = value; }
        }

        private int m_width;
        /// <summary>
        /// x方向上单元格个数
        /// </summary>
        public int Width
        {
            get { return m_width; }
            set { m_width = value; }
        }

        private int m_height;
        /// <summary>
        /// y方向上单元格个数
        /// </summary>
        public int Height
        {
            get { return m_height; }
            set { m_height = value; }
        }

        private int[][] m_grid;
        /// <summary>
        /// 点矩阵,或char[,]
        /// </summary>
        public int[][] Grid
        {
            get { return m_grid; }
            set { m_grid = value; }
        }

        private string m_props;
        /// <summary>
        /// 继承自map
        /// 属性串,保存房间的属性,例如：
        /// 隐身失效，时间加速等，数据结构待定
        /// </summary>
        public string Props
        {
            get { return m_props; }
            set { m_props = value; }
        }

        public Room() { }

        public Room(int id, string name) : this(id, name, 1, 1, null, null) { }

        public Room(int id, string name, int width, int height, int[][] grid, string props)
        {
            this.m_id = id;
            this.m_name = name;
            this.m_width = width;
            this.m_height = height;
            this.m_grid = grid;
            this.m_props = props;
        }
    }
}
